using System;
using System.IO;
using Hive.Core.Common.Shell;

namespace Hive.Core.Model.Commands
{
    /// <summary>
    /// Gets the binary of a package branch.
    /// </summary>
    public class GetBinaryPackageBranchCommand : BasePackageBranchCommand
    {
        /// <summary>
        /// Gets or sets the version label of the version to get.
        /// </summary>
        public string VersionLabel { get; set; }

        /// <inheritdoc />
        protected override CommandExitCode ExecuteWithPackageBranch(IHiveManager hiveManager, IShell shell, IPackageBranch packageBranch)
        {
            packageBranch.GetBinary(VersionLabel, shell);

            return CommandExitCode.Success;
        }
    }
}